<?php

namespace Cuke\Models;

class CukeParameter extends ModelBase
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $param_id;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=false)
     */
    public $param_name;

    /**
     *
     * @var string
     * @Column(type="string", length=2000, nullable=false)
     */
    public $param_value;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=false)
     */
    public $param_location;

    /**
     *
     * @var string
     * @Column(type="string", length=2000, nullable=true)
     */
    public $default_value;

    /**
     *
     * @var integer
     * @Column(type="integer", length=1, nullable=false)
     */
    public $is_required;

    /**
     *
     * @var string
     * @Column(type="string", length=10000, nullable=true)
     */
    public $demo_value;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $description;

    /**
     *
     * @var string
     * @Column(type="string", length=1000, nullable=true)
     */
    public $regular_expression;

    /**
     *
     * @var string
     * @Column(type="string", length=200, nullable=false)
     */
    public $conector_code;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSource("cuke_parameter");
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'cuke_parameter';
    }
    public function beforeUpdate()
    {
        $this->update_at = date('Y-m-d H:i:s');
    }
    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return CukeParameter[]|CukeParameter|\Phalcon\Mvc\Model\ResultSetInterface
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return CukeParameter|\Phalcon\Mvc\Model\ResultInterface
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
